﻿using Core.EF.Entitys;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Core.EF
{
    public class MyContext : DbContext
    {


        public MyContext(DbContextOptions<MyContext> options) : base(options)
        { }

        public DbSet<Blog> Blogs { get; set; }
        public DbSet<Post> Posts { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //配置mariadb连接字符串 
            //optionsBuilder.UseSqlServer("Data Source=.;Initial Catalog=BloggingDB;User ID=sa,pwd=123456;");
            //.UseMySql("Server=localhost;Port=3306;Database=BloggingDB; User=root;Password=;"); }
        }
    }
}